package com.bestcem.xm.deliver.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bestcem.xm.component.mybatis.base.ResultPage;
import com.bestcem.xm.component.mybatis.service.IXmService;
import com.bestcem.xm.deliver.controller.v2.param.*;
import com.bestcem.xm.deliver.controller.v2.vo.DeliverStoreVo;
import com.bestcem.xm.deliver.controller.v2.vo.DeliverVo;
import com.bestcem.xm.deliver.controller.v2.vo.SurveyDeliverPageVo;
import com.bestcem.xm.deliver.entity.DeliverDefaultDeliver;
import com.bestcem.xm.deliver.entity.DeliverDefaultDeliverStore;

/**
 * @author been
 * @description 针对表【ds_deliver_defaultdeliver】的数据库操作Service
 * @createDate 2022-11-07 13:49:46
 */
public interface DeliverDefaultDeliverService extends IXmService<DeliverDefaultDeliver> {

    /**
     * 获取默认投放
     *
     * @param projectId projectId
     * @param userId    userId
     * @param orgId     orgId
     * @return 投放
     */
    DeliverVo getDefaultDeliver(String projectId, String userId, String orgId);

    /**
     * 获取默认序列
     *
     * @param param param
     * @return 序列
     */
    JSONObject getDefaultSequence(SequenceParam param);

    /**
     * 获取默认序列
     *
     * @param page  page
     * @param param param
     * @return 序列
     */
    ResultPage<SurveyDeliverPageVo> getSelectDeliver(Page<SurveyDeliverPageVo> page, SelectParam param);

    /**
     * 判断是否存在
     *
     * @param projectId projectId
     * @param userId    userId
     * @param orgId     orgId
     * @return 数据
     */
    JSONObject surveyRegionExist(String projectId, String userId, String orgId);

    /**
     * 获取投放
     *
     * @param projectId projectId
     * @param userId    userId
     * @param orgId     orgId
     * @return 数据
     */
    JSONObject getDeliverStore(String projectId, String userId, String orgId);

    /**
     * 批量修改
     *
     * @param projectId        projectId
     * @param batchSwitchParam batchSwitchParam
     * @return 数据
     */
    JSONObject batchSwitch(String projectId, BatchSwitchParam batchSwitchParam);

    /**
     * 单个修改
     *
     * @param id          id
     * @param switchParam switchParam
     * @return 数据
     */
    JSONObject oneSwitch(String id, SwitchParam switchParam);

    /**
     * 分页查询
     *
     * @param page  page
     * @param param param
     * @return 数据
     */
    ResultPage<DeliverStoreVo> getStorePage(Page<DeliverDefaultDeliverStore> page, GetStorePageParam param);

    /**
     * 获取投放进度
     *
     * @param taskId taskId
     * @param userId userId
     * @param orgId  orgId
     * @return 数据
     */
    JSONObject getDeliverTaskProcess(String taskId, String userId, String orgId);

    JSONObject getSurveyDeliverPage(GetSurveyDeliverParam param);

    JSONObject defaultOneSwitch(String id, SwitchParam switchParam);
}
